extends "../calxJS_Hide/calxJS_Hide.gd"
func _init():
	pass
func _extInit():
	._extInit()
	chaName = "小花苞"                   # 角色的名称
	attCoe.atkRan = 2                 # 攻击距离
	attCoe.maxHp = 6                 # 最大生命（每点代表112.5基础数值，取整数，下同）
	attCoe.atk = 4                    # 攻击力（每点代表8.5）
	attCoe.mgiAtk = 6                 # 魔法攻击（每点代表13.7）
	attCoe.def = 4.5                    # 物理防御（每点代表15）
	attCoe.mgiDef = 4.5                # 魔法防御（每点代表16.6）
	atkEff = "atk_dang" 
	xb = "木"
	lv = 3	
	addSkillTxt("[叶绿素]最近的3名友军获得抵御，魔御各5层[CD:5]")
	addSkillTxt("[蝶影重重]挥出蝴蝶攻击敌方单体，造成120%木系魔法伤害，获得8%最大体力值的护盾[CD:9]")
	addSkillTxt("[春风拂袖]感受春风的号召，提升自身物防和魔防共30%,每个属性最高60%[CD:16]")
	addCdSkill("feihua",5)
	addCdSkill("dycc",9)
	addCdSkill("tmzj",13)
	addCdSkill("cffx",16)

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "dycc":
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText("蝶影重重", "#FF0099")
		eff.anim.set_speed_scale(0.2)
		typeHurtCha(aiCha,att.mgiAtk*1.2,Chara.HurtType.MGI,Chara.AtkType.SKILL)
		changeShield(att.maxHp*0.08)
	if id == "cffx":
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText("春风拂袖", "#FF0099")
		eff.anim.set_speed_scale(0.2)
		var n = sys.rndRan(1,2)
		for i in range(3):
			if n == 1:
				var bf1 = hasBuff("wukang1")
				if bf1 == null:
					addBuff(bf.wukang1.new())
				elif bf1.att.defL < 0.6:
					bf1.att.defL += 0.1
			if n == 2:
				var bf2 = hasBuff("mokang1")
				if bf2 == null:
					addBuff(bf.mokang1.new())
				elif bf2.att.mgiDefL < 0.6:
					bf2.att.mgiDefL += 0.1
	if id == "feihua":
		var chas = getAllChas(2)
		chas.sort_custom(self,"sort")
		for i in range(3):
			if i >= chas.size() : break
			chas[i].addBuff(b_diYu.new(5))
			chas[i].addBuff(b_moYu.new(5))
func sort(a,b):
	if cellRan(a.cell,cell) < cellRan(b.cell,cell) :
		return true
	return false

	


class kangxing:
	extends Buff
	func _init(lv=1):
		._init()
		id="kangxing"
		isNegetive=true
		life=lv
	func _onHurt(atkInfo):
		._onHurt(atkInfo)
		atkInfo.hurtVal *= 0.6